<template>
	<view class="all-main">
		<view class="main">
			<view class="content">
				<view class="img">
					<u-icon name="checkmark-circle" color="#19be6b" size="60"></u-icon>
				</view>
				<view class="title">
					<text>{{title}}</text>
				</view>
				<view class="msg">
					<text>{{msg}}</text>
				</view>
			</view>
			<view class="btns" @click="submits">
				<text>完成</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '',
				msg: ''
			}
		},
		onLoad() {
			this.loadData()
		},
		methods: {
			// 加载数据
			async loadData() {
				uni.showLoading({
					title: '加载中'
				});
				const {
					data: res
				} = await this.$myHttp({
					url: 'v1/getSuccessInfo'
				});
				uni.hideLoading()
				if (res.code == 200) {
					this.title = res.data.title
					this.msg = res.data.msg
				}
			},
			// 点击完成
			submits() {
				uni.reLaunch({
				    url: '/pages/index/index'
				});
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #ffffff; /* 设置背景颜色 */
	}
	.all-main {
		.main {
			.content {
				margin-top: 120rpx;
				text-align: center;
				
				.img {
					display: flex;
					justify-content: center;
				}
				
				.title {
					padding-top: 30rpx;
				}
				
				.msg {
					padding-top: 20rpx;
					color: #909399;
				}
			}
			
			.btns {
				position: fixed;
				left: 25%;
				right: 25%;
				bottom: 80rpx;
				background-color: #f2873a;
				color: #ffffff;
				text-align: center;
				padding: 20rpx;
				border-radius: 16rpx;
			}
		}
	}
</style>
